#include "buzzer.h"

#include "Arduino.h"


Buzzer::Buzzer(int pin)
{
    beep_pin = pin;
}

void Buzzer::init()
{
    pinMode(beep_pin, OUTPUT);
}

void Buzzer::beep(unsigned long time_ms)
{
    digitalWrite(beep_pin, HIGH);
    delay(time_ms*1000);
    digitalWrite(beep_pin, LOW);
}

void Buzzer::startBeeping()
{
    digitalWrite(beep_pin, HIGH);
}

void Buzzer::stopBeeping()
{
    digitalWrite(beep_pin, LOW);
}
